<?php
$url="http://www.geyanw.com/";

$ch = curl_init();
//设置选项，包括URL
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//执行并获取HTML文档内容
$output = curl_exec($ch);
//释放curl句柄
curl_close($ch);
//打印获得的数据
$reg='#<div id="nav">["\r\n\s"]*<ul>(.*)</ul>["\r\n\s"]*</div>#Us';
preg_match_all($reg, $output, $outputs);
print_r($outputs);

?>